﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TempSerialPort
{
    internal class Program
    {
        
        static void Main(string[] args)
        {
            SerialPort serialPort1=new SerialPort();    
            OMRtemp ormTemp = new OMRtemp();
            ormTemp.InitSerialPort(serialPort1,"COM3");
            string str1 = string.Empty;
            for (int i = 1; i < 7; i++)
            {
                string str2 = ormTemp.ReadTemp(out str1, "0"+i.ToString());//读表1
                Console.WriteLine(str2);
            }
            ormTemp.SetTemp(161.5, out str1, "06");//写表1        
            Console.WriteLine(str1);
            ormTemp.Close();
            Console.Read();
        }

    
    }
}
